<@_placeMetadata path=path><#assign a=object/></@_placeMetadata>
<form method="post" autocomplete="off" action="cmsTemplate/savePlaceMetaData?navTabId=placeTemplate/list" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
    <input type="hidden" name="_csrf" value="<@_csrfToken admin=true/>"/>
    <div class="formBar">
        <ul>
        <#if a?has_content>
            <li><a class="button" href="placeTemplate/content.html?path=${(path?url)!}" target="ajax" rel="cmsTemplatePlace"><@t.page 'template.content'/></a></li>
        </#if>
            <@_createLock itemType='placeTemplate' itemId=path userId=admin.id>
                <#if object?has_content||!path?has_content>
            <li><button type="submit" class="buttonActive" title="ctrl+s"<#if path?has_content> close-url="common/unlock?itemType=placeTemplate&itemId=${(path?url)!}"</#if>><@t.page 'button.save'/></button></li>
                <#else>
            <li>
                <@_sysLock userId=admin.id itemType='placeTemplate' itemId=path>
                    <@_sysUser id=(object.userId)!''><#assign lockUser=object.nickName/></@_sysUser>
                <button type="button" class="buttonDisabled" title="${object.createDate}"><@t.page 'lock.message' lockUser/></button>
                </@_sysLock>
            </li>
                </#if>
            </@_createLock>
        </ul>
    </div>
    <div class="pageFormContent" layoutH>
        <dl class="nowrap">
            <dt><@t.page 'path'/>:</dt></dt>
            <dd>
            <#if path?has_content>
                ${path}
                <input name="path" type="hidden" value="${path}" size="40"/>
            <#else>
                <input name="path" type="text" value="/${getUUID()}.html" size="40"/>
            </#if>
            </dd>
        </dl>
        <dl class="nowrap">
            <dt><@t.page 'alias'/>:</dt></dt>
            <dd>
                <input class="required" name="alias" type="text" maxlength="50" size="20" value="${(a.alias)!}"/>
                <span class="placeExtend">
                    <label>
                        <input name="allowContribute" type="checkbox" onclick="if($(this).is(':checked')){$('.allowContribute',navTab.getCurrentPanel()).show()}else{$('.allowContribute',navTab.getCurrentPanel()).hide()}"/>
                        <@t.page 'allow_contribute'/>
                    </label>
                    <label class="allowContribute hide">
                        <input name="allowAnonymous" type="checkbox"${((a.allowAnonymous)?has_content&&a.allowAnonymous)?then(' checked="checked"','')?no_esc}/>
                        <@t.page 'allow_anonymous_contribute'/>
                    </label>
                </span>
            </dd>
        </dl>
        <#if a?has_content&&a.allowContribute>
            <script>
                $('input[name=allowContribute]',navTab.getCurrentPanel()).click();
            </script>
        </#if>
        <dl class="nowrap">
            <dt><@t.page 'place_data.page_size'/>:</dt>
            <dd>
                <input name="size" class="required digits" type="number" value="${(a.size)!0}"/>
            </dd>
        </dl>
        <dl class="nowrap placeExtend">
            <dt><@t.page 'item_type'/>:</dt>
            <dd>
                <label><input name="acceptItemTypes" type="checkbox" value="content"<#if (a.acceptItemTypes)?has_content&&a.acceptItemTypes?seq_contains('content')> checked="checked"</#if>/><@t.page 'content'/></label>
                <label><input name="acceptItemTypes" type="checkbox" value="page"<#if (a.acceptItemTypes)?has_content&&a.acceptItemTypes?seq_contains('page')> checked="checked"</#if>/><@t.page 'page'/></label>
                <label><input name="acceptItemTypes" type="checkbox" value="category"<#if (a.acceptItemTypes)?has_content&&a.acceptItemTypes?seq_contains('category')> checked="checked"</#if>/><@t.page 'category'/></label>
            </dd>
        </dl>
        <dl class="nowrap placeExtend">
            <dt><@t.page 'place_data.master'/>:</dt>
            <dd>
                <input name="userId" type="hidden"/>
                <input name="nickName" type="hidden"/>
                <a class="btnLook" href="sysUser/lookup.html" width="920" lookupGroup=""><@t.page 'user.select'/></a>
                <div class="tagsBox adminIds"></div>
            </dd>
        </dl>
        <fieldset class="placeExtend systemField">
            <legend><@t.page 'place.system_field'/></legend>
            <dl class="nowrap">
                <dt>
                    <label><@t.page 'field.title'/>:</label>
                </dt>
                <dd>
                    <input name="fieldTextMap[title]" class="required" type="text" maxlength="20" size="10" value="${(a.fieldTextMap['title'])!t.pageMessage('title')}"/>
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>
                    <label><input name="fieldList" type="checkbox" value="url"/><@t.page 'field.url'/></label>
                </dt>
                <dd>
                    <label><@t.page 'text'/>:</label>
                    <input name="fieldTextMap[url]" type="text" maxlength="20" size="10" value="${(a.fieldTextMap['url'])!t.pageMessage('url')}"/>
                    <label><input name="requiredFieldList" type="checkbox" value="url"/><@t.page 'required'/></label>
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>
                    <label><input name="fieldList" type="checkbox" value="cover"/><@t.page 'cover'/></label>
                </dt>
                <dd>
                    <label><@t.page 'text'/>:</label>
                    <input name="fieldTextMap[cover]" type="text" maxlength="20" size="10" value="${(a.fieldTextMap['cover'])!t.pageMessage('cover')}"/>
                    <label><input name="requiredFieldList" type="checkbox" value="cover"/><@t.page 'required'/></label>
                    <label><@t.page 'width'/></label><input name="coverWidth" type="number" size="5" value="${(a.coverWidth)!}"/>
                    <label><@t.page 'height'/></label><input name="coverHeight" type="number" size="5" value="${(a.coverHeight)!}"/>
                </dd>
            </dl>
        </fieldset>
        <fieldset class="placeExtend">
            <legend><@t.page 'place_data.extend_field'/>(<@t.page 'metadata.default_value_description'/>)</legend>
            <#include '../include_page/extends.html'/>
            <#assign extendList=(a.extendList)![]/>
            <@extends 'extendList' extendList/>
        </fieldset>
<script>
$('.systemField dt [type=checkbox]',navTab.getCurrentPanel()).each(function(){
    var box = $(this).parent().parent().parent();
    box.find('dd').hide();
    $(this).click(function(){
        if( $(this).is(':checked') ) {
            box.find('dd').show().find('input[type=text]').addClass('required');
        } else {
            box.find('dd').hide().find('input[type=text]').removeClass('required').val('');
        }
    });
});
<#if (a.fieldList)?has_content>
<#list a.fieldList as field>
    $('input[name=fieldList][value=${field}]',navTab.getCurrentPanel()).click();
</#list>
</#if>
<#if (a.requiredFieldList)?has_content>
<#list a.requiredFieldList as field>
    $('input[name=requiredFieldList][value=${field}]',navTab.getCurrentPanel()).click();
</#list>
</#if>
$('input[name=size]',navTab.getCurrentPanel()).on('change',function(){
    checkPageSize();
});
$('input[name=nickName]',navTab.getCurrentPanel()).on('change',function(){
    addUser($('input[name=\'userId\']',navTab.getCurrentPanel()).val(),$(this).val());
});
$('.adminIds',navTab.getCurrentPanel()).on('click','span>a',function(){
    $(this).parent().remove();
    return false;
});
checkPageSize();
<#if (a.adminIds)?has_content>
    <@_sysUser ids=a.adminIds>
        <#list map as k,user>
        addUser('${k}','${user.nickName}');
        </#list>
    </@_sysUser>
</#if>
</script>
        <textarea name="content" class="hide"></textarea>
        <textarea class="content hide"><#noparse>
<#list page.list>
    <ul>
    <#items as a>
        <li>
            <figure>
                <!-- ${a.itemType!} : ${a.itemId!} ,place/redirect:count and 301 jump to a.url,place/click:count and 302 jump to a.url-->
                <a href="${site.dynamicPath}place/redirect?id=${a.id!}" target="_blank"><img src="${a.cover!}"></a>
                <figcaption><a href="${a.url!}" target="_blank">${a.title!}</a>(${a.clicks!})</figcaption>
                </#noparse><@t.page 'extend_field'/>:<#noparse><#assign attribute=getPlaceAttribute(a.id)/>
            </figure>
        </li>
    </#items>
    </ul>
</#list>
</#noparse></textarea>
    </div>
</form>